//
//  setListViewController.m
//  TeamInformatization
//
//  Created by bigger on 2019/3/31.
//  Copyright © 2019年 SPIC. All rights reserved.
//

#import "setListViewController.h"
#import "LogoSetTableViewCell.h"
#import "SetTableViewCell.h"

@interface setListViewController () <UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, strong) UITableView *personSetTableView;


@end

@implementation setListViewController

{
    NSArray *_setNameArray;
    
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self showTitleBarWithTitle:@"设置" leftButtonStyle:Base_NavigationBar_Back rightButtonStyle:Base_NavigationBar_None];
    // 初始化
    _setNameArray = @[@"头像", @"电子签名", @"姓名", @"性别", @"账号", @"身份证号", @"密码", @"班组", @"工种"];
    
    [self loadShowViews];
}

// UI
- (void)loadShowViews
{
    self.personSetTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, kSafeAreaTopHeight, kScreenWidth, kScreenHeight - kSafeAreaBottomHeight - kSafeAreaTopHeight) style:UITableViewStylePlain];
    [_personSetTableView registerClass:[SetTableViewCell class] forCellReuseIdentifier:@"SetCell"];
    [_personSetTableView registerClass:[LogoSetTableViewCell class] forCellReuseIdentifier:@"LogoSet"];
    _personSetTableView.delegate = self;
    _personSetTableView.dataSource = self;
    _personSetTableView.backgroundColor = [UIColor clearColor];
    _personSetTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    _personSetTableView.showsVerticalScrollIndicator = NO;
    [self.view addSubview:_personSetTableView];
    
}


#pragma mark - TableViewDelegate/DataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return _setNameArray.count;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 50 * kScaleWidth;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    //    ActiveTeam *activeTeam = [[ActiveTeam alloc] init];
    //    if (self.teamListArray.count != 0) {
    //        activeTeam = self.teamListArray[indexPath.row];
    //    }
    
    if (indexPath.row == 0) {
        
        LogoSetTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"LogoSet" forIndexPath:indexPath];
        if (!cell) {
            cell = [[LogoSetTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"LogoSet"];
        }
        
        [cell setCellTitle:_setNameArray[indexPath.row] LogoImageStr:@""];
        
        return cell;
        
    } else {
        SetTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SetCell" forIndexPath:indexPath];
        if (!cell) {
            cell = [[SetTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SetCell"];
        }
        
        [cell setCellTitle:_setNameArray[indexPath.row] ContentText:@""];
        
        return cell;
    }

}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}

#pragma -导航栏 两边按钮操作
-(void)baseNavigationBarLeftButtonClick:(UIButton *)button
{
    [self.navigationController popViewControllerAnimated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
